Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade mixed syntax #2095

Merged
merged 3 commits into from
Jan 7, 2017
Merged

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Dec 22, 2016

Closes #2094

Note: #2094 was reported with 6.11.2, I can backport this if we are planning another 6.11.x release.

1) Fixes a problem in the upgrader class whereby the following config:

[runtime]
    [[foo]]
        [[[job submission]]]
            zarquon = True

Would fail to be caught by this upgrader:

u = upgrader(cfg, descr)
u.obsolete(
    '7.0.0',
    ['runtime', '__MANY__', 'job', 'zarquon'])
u.upgrade()

Old behaviour:

$ cylc validate .
Illegal item: [runtime][foo][job]zarquon

New behaviour:


[osanders@eld668 temp2]$ cylc validate --verbose .
...
WARNING: deprecated items were automatically upgraded in 'suite definition':
 * (7.0.0) [runtime][foo][job][zarquon] - DELETED (OBSOLETE)
...
Valid for cylc-7.0.0-dirty

2. Fixes upgrading of mixed-syntax job submission/job sections

The following config ...

...
[runtime]
    [[foo]]
        command scripting = sleep 5  # old
        [[[job submission]]]         # old
            batch system = at        # new
            retry delays = PT1M      # old
        [[[event hooks]]]            # old
            failed handler = true    # old/new

Will now parse correctly:

$ cylc get-config --sparse . -i [runtime]
[[root]]
[[foo]]
    script = sleep 5
    [[[events]]]
        failed handler = true
    [[[job]]]
        batch system = at
        submission retry delays = PT1M

With the following notices from validate:

[osanders@eld668 temp2]$ cylc validate --verbose --verbose .
...
WARNING: deprecated items were automatically upgraded in 'suite definition':
 * (6.4.0) [runtime][foo][command scripting] -> [runtime][foo][script] - value unchanged
 * (6.11.0) [runtime][foo][event hooks] -> [runtime][foo][events] - value unchanged
 * (6.11.0) [runtime][foo][job submission] -> [runtime][foo][job] - value unchanged
 * (6.11.0) [runtime][foo][job][retry delays] -> [runtime][foo][job][submission retry delays] - value
...
Valid for cylc-7.0.0-dirty

Caveat: the deprecation warning now reads [runtime][foo][job][retry delays] rather than [runtime][foo][job submission][retry delays] which could be a little cryptic.

3) Upgrade section headings rather than the settings within them (in cylc/cfgspec/suite.py)

e.g. upgrade [event handlers] to [events] rather than upgrading [event handlers]failed handler to [events]failed handler then [event handlers]xyz to [events]xyz ...

@arjclark @matthewrmshin @hjoliver Whoever's around please debate / review.

@oliver-sanders oliver-sanders added this to the next release milestone Dec 22, 2016
@oliver-sanders oliver-sanders self-assigned this Dec 22, 2016
Copy link
Contributor

@matthewrmshin matthewrmshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@hjoliver
Copy link
Member

hjoliver commented Jan 7, 2017

@oliver-sanders - we are planning another 6.11.x release now; could you backport this plz.

Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@hjoliver hjoliver merged commit 1f2a0c7 into cylc:master Jan 7, 2017
['runtime', '__MANY__', 'job', 'batch submit command template'])
u.deprecate(
'6.11.0',
['runtime', '__MANY__', 'job submission', 'shell'],
['runtime', '__MANY__', 'job', 'shell'],
['runtime', '__MANY__', 'job', 'shell'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliver-sanders - this deprecate call is now redundant - the 'old' and 'new' args are the same (sorry, I missed this yesterday!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted! I've updated the back-port and have put up a new pull (#2103) for 7.0.x.

@oliver-sanders oliver-sanders deleted the upgrade-mixed-syntax branch May 23, 2017 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants